/*
 * @Author: your name
 * @Date: 2020-12-08 13:32:28
 * @LastEditTime: 2021-07-22 14:11:48
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /medicine-web/src/utils/auth.js
 */
import Cookies from 'js-cookie'

const TokenKey = 'token'

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}
// cookie 7天
export function setCookie(field, value) {
  return Cookies.set(field, value, { expires: 7 })
}
export function getCookie(field) {
  return Cookies.get(field)
}
export function removeCookie(field) {
  return Cookies.remove(field)
}